<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>诗词乐游飞花令 - 游戏列表</title>
    <script>
        const logoutUrl = "{{url_for('player.logout_player')}}"
        const loginWebUrl = "{{url_for('player.login_player_web')}}"
    </script>
    <script src="{{ url_for('static',filename='js/jquery-3.7.1.min.js') }}"></script>
    <script src="{{ url_for('static',filename='js/dashboard_player_web.js') }}"></script>
    <script src="{{ url_for('static',filename='js/layui.js') }}"></script>
    <link rel="stylesheet" href="{{ url_for('static',filename='css/layui.css') }}">
    <link rel="icon" href="{{ url_for('static',filename='img/logo.ico') }}">
    <style>
        body {
            margin: 0;
            padding: 20px;
            background-color: #f5f5f5;
            font-family: 'Microsoft YaHei', sans-serif;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
            background-color: white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            border-radius: 8px;
            margin-bottom: 20px;
        }

        .login_box {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .paper table {
            width: 100%;
            border-collapse: collapse;
        }

        .paper th, .paper td {
            padding: 12px;
            text-align: center;
            border: 1px solid #e0e0e0;
        }

        .paper th {
            background-color: #f8f8f8;
            font-weight: bold;
            color: #333;
        }

        .paper td {
            background-color: #fff;
        }

        .paper button {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            background-color: #1E9FFF;
            color: white;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .paper button:hover {
            background-color: #0d8bf2;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }

        .message {
            text-align: center;
            margin-bottom: 20px;
            color: #666;
        }
    </style>
</head>

<body>
    <div class="header">
        <form>
            <button id="logout" class="layui-btn layui-bg-red">退出登录</button>
        </form>
    </div>

    <div class="message"></div>
    <div class="login_box">
        <div class="paper">
            <table>
                <thead>
                    <tr>
                        <th>游戏编号</th>
                        <th>当前分数</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {%- for paper in my_papers: %}
                    <tr>
                        <td>{{ paper.id }}</td>
                        <td>{{ paper.score }}</td>
                        <td>
                            <button onclick="location.href='/player/play/{{ paper.id }}'">继续</button>
                        </td>
                    </tr>
                    {%- endfor %}
                    <tr>
                        <td>新游戏</td>
                        <td>-</td>
                        <td>
                            <button onclick="location.href='/player/create_game'">新游戏</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="audio-player">
        <audio src="{{ url_for('static',filename='music/鲸鱼音频.MP3') }}" id="background-music" controls="controls" loop="loop" autoplay="autoplay"></audio>
    </div>
</body>

</html>
